Skip to content

Use better error message for hard errors in CTFE#86340

Merged
bors merged 2 commits intorust-lang:masterfrom
syvb:ctfe-hard-error-message
Jun 17, 2021
Merged

Use better error message for hard errors in CTFE#86340
bors merged 2 commits intorust-lang:masterfrom
syvb:ctfe-hard-error-message

Conversation

@syvb
Copy link
Contributor

@syvb syvb commented Jun 15, 2021

I noticed this while working on #86255: currently the same message is used for hard errors and soft errors in CTFE. This changes the error messages to make hard errors use a message that indicates the reality of the situation correctly, since usage of the constant is never allowed when there was a hard error evaluating it. This doesn't affect the behaviour of these error messages, only the content.

This changes the error logic to check if the error should be hard or soft where it is generated, instead of where it is emitted, to allow this distinction in error messages.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants